//获取应用实例
const util = require('../../utils/util');
const config = require('../../common/config');

var app = getApp();
Page({
    data: {
        userInfo: {},
        balance:'0.00',
        consumeIntegral:0,
        tools: [{
            imgPath: config.WEB_ROOT + "/images/icons/qianbao.png"
        }, {
            imgPath: config.WEB_ROOT + "/images/icons/jifen.png"
        }, {
            imgPath: config.WEB_ROOT + "/images/icons/saoma.png"
        }, {
            imgPath: config.WEB_ROOT + "/images/icons/zhangdan.png"
        }]
    },
    onLoad: function () {
        var _this = this;
        app.getUserInfo(function (userInfo) {
            _this.setData({
                userInfo: userInfo
            })

            //请求后端业务系统，获取'我的'页面内容和'个人信息'
            app.updateWxUserinfo();
        })

    },
    scanCode: function () {
        app.scanQrCode(function (res) {
            if (res.errMsg != 'scanCode:ok') {
                util.debug(res.errMsg);
            } else {
                util.debug(res);
            }
        })
    },
    balanceDetail:function (e) {

    },
    integralDetail:function (e) {

    },
    accountDetail:function (e) {

    }
});
